package cn.dansj.exception;

import cn.dansj.common.utils.enums.ResponseCode;

public class InterfaceResponseException extends RuntimeException {
    private final int errorCode;

    public InterfaceResponseException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public InterfaceResponseException(ResponseCode responseCode){
        this(responseCode.getStatusCode(), responseCode.getError());
    }

    public int getErrorCode() {
        return errorCode;
    }
}
